#include "baseShm.h"
#include <unistd.h>
#include <string.h>
#include <iostream>

int main()
{
    daniel::BaseShm::ptr shm(new daniel::BaseShm(100,4096));
    void* start=shm->attachToProcess();
    const char* msg="hello world!";
    memcpy(start,msg,strlen(msg));
    std::cout<<"press a key to continue!"<<std::endl;
    getchar();
    shm->detachFromProcess();
    //共享内存好像不能重复调用destroy
    shm->destroyShm();

    return 0;
}